package com.qqtech.qquan.homemaking.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.qqtech.core.frame.dao.BaseDaoImpl;
import com.qqtech.qquan.homemaking.model.*;

@Repository
public class HomemakingTypeDaoImpl extends BaseDaoImpl<HomemakingType> implements HomemakingTypeDao {
	public static final Logger log = LoggerFactory.getLogger(HomemakingTypeDaoImpl.class);
	
	public HomemakingTypeVo getByName(java.lang.String name) {
		return sqlSessionTemplate.selectOne(getSqlName("selectByName"), name);
	}

	@Override
	public Page<HomemakingTypeVo> queryPageListAdmin(HomemakingType query,
			Pageable pageable) {
		List<HomemakingTypeVo> contentList = sqlSessionTemplate.selectList(getSqlName("selectAdmin"), getParams(query, pageable));
		return new PageImpl<HomemakingTypeVo>(contentList, pageable, this.queryCount(query));
	}	
}
